///////////////////////////////////////////////////////////
*** 	Leader of the Free World or Pioneer in Democracy’s Decline?  ***
*** 	Date: 					2019/12/16
***		Authors:				Wuttke, Alexander; Gavras, Konstantin, Schoen Harald
***		Harvard Dataverse:		
***		Content:				This master syntax executes all data wrangling to produce a recoded dataset (data_supportdemocracy_ger.dta) which is then used to run the analyses (in R)
***								This master syntax calls multiple do-files, one do-file for each data set that is to be recoded								
///////////////////////////////////////////////////////////

** ENTER YOUR WORKING DIRECTORY HERE ! **

cd ""


*Install necessary Ados


ssc install fre, replace
ssc install tabplot, replace
ssc install lgraph, replace

ssc install blindschemes
set scheme plotplainblind, perm


*Version
version 15.1 

*Preparation
clear 
set more off




*This syntaxs contains the terms that will be used constiently as variable names throughout the various survey datasets. 
*Using macros enables to easily modify the variable names throughout the research process
do "syntax\macro.do"

*Recoding datasets
do "syntax\recode_ZA1487.do"													//1986; 1989

do "syntax\recode_ZA2809.do"													//1992

do "syntax\recode_ZA3033.do"													//1993

do "syntax\recode_ZA3065.do"													//1994

do "syntax\recode_ZA2820.do"													//1995

do "syntax\recode_ZA2965.do"													//1996

do "syntax\recode_ZA3066.do"													//1998

do "syntax\recode_ZA3861.do"													//2002

do "syntax\recode_ZA4662.do"													//2005

do "syntax\recode_ZA5321.do"													//2005

do "syntax\recode_ZA4586.do"													//1980-2016

do "syntax\recode_ZA5270.do"													//2018

*Appending datasets, creating flag_variables and labelling variables
*Save Dataset
do "syntax\append_all.do"

/*
use data_supportdemocracy_ger.dta, clear
*/



